package com.qys.livesMall.shop.modal.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.qys.livesMall.common.serial.LocalDateTimeToTimestampSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author gmx
 * @since 2023-06-07
 */
@Data
@TableName("h2_shop_goods_info")
@Schema(name = "ShopGoodsInfo", description = "")
public class ShopGoodsInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "店铺id")
    private Long shopId;

    @Schema(description = "商品id")
    private Long goodsId;

    @Schema(description = "商品名称")
    private String goodsName;
    @Schema(description="一级分类")
    private Long categoryOneId;
    @Schema(description="二级分类")
    private Long categoryTwoId;
    @Schema(description = "商品描述")
    private String goodsDesc;

    @Schema(description = "原价")
    private BigDecimal originalPrice;

    @Schema(description = "现价")
    private BigDecimal price;

    @Schema(description = "状态")
    private boolean status;

    @Schema(description = "销量")
    private Integer salesVolume;
    @Schema(description = "图片")
    private String image;
    @Schema(description = "图片")
    private String images;

    @Schema(description = "关注量")
    private Integer interestNum;
    @Schema(description = "删除：1未删除2删除")
    private String isDelete;

    @Schema(description = "订单创建时间")
    @JsonSerialize(using = LocalDateTimeToTimestampSerializer.class)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private LocalDateTime createTime;

    @Schema(description = "订单更新时间")
    @JsonSerialize(using = LocalDateTimeToTimestampSerializer.class)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private LocalDateTime updateTime;

    /**
     * 退货中 0：否，1：是
     */
    private Integer returning;

    /**
     * 最后上架/采购时间
     */
    private LocalDateTime upShelfDate;

    @TableField(exist = false)
    private Integer totalInventory;
}
